@import "../../style/common.less";

.func-box {
    display: block;
    margin: 0 12px 12px;
    background-color: @cff;
    box-shadow: 0 0 5px rgba(0, 0, 0, .1);
    >.title {
        display: block;
        height: 40px;
        padding: 10px 12px;
        font-size: 14px;
        line-height: 20px;
        color: @primary;
        &::before {
            content: '';
            display: inline-block;
            vertical-align: bottom;
            width: 3px;
            height: 20px;
            background-color: @primary;
            margin-right: 10px;
        }
    }
    >.box {
        display: block;
        position: relative;
        .clear();
        padding: 8px;
        border-top: 1px solid @cdd;
        >.item {
            float: left;
            width: 25%;
            >.icon {
                display: block;
                width: 50px;
                height: 50px;
                margin: auto;
                background-position: center;
                background-size: 36px;
                background-repeat: no-repeat;
                // &.product-list {
                //     background-image: url("../../images/home/product-list.png");
                // }
                // &.product-new {
                //     background-image: url("../../images/home/product-new.png");
                // }
                .loop();
            }
            >.text {
                display: block;
                text-align: center;
                font-size: 12px;
                color: @primary;
            }
        }
    }
}
// @icons: product-list product-new project-list project-new purchase-list purchase-new receive-list receive-new setting supplier-list supplier-new;
// .digui(@index: 1) when(@index <= length(@icons)){
//     @icon: extract(@icons, @index);
//     &.@{icon} {
//         background-image: url("../../images/home/@{icon}.png");
//     }
//     .digui(@index + 1);
// }
// 写递归方法，将图片名字作为参数
// 数组（less中数组取值从1开始）
@icons: product-list product-new project-list project-new purchase-list purchase-new receive-list receive-new setting supplier-list supplier-new;

.loop(@index: 1) when(@index <= length(@icons)) {
    // 读取数组中的数据
    @icon: extract(@icons, @index);
    &.@{icon} {
        background-image: url("../../images/home/@{icon}.png");
    }
    .loop(@index + 1);
}





.char-list {
    display: block;
    height: 260px;
    >.chart-box{
        height: 100%;
    }
}